package org.rkuk.kasutil.test.mediaState 
{
	import flash.display.Loader;
	import flash.events.Event;
	import flash.net.URLRequest;
	import flexunit.framework.TestCase;
	
	/**
	 * ...
	 * @author rkuk
	 */
	public class MediaStateTestCase extends TestCase 
	{
		protected var loader:Loader;
		
		public function MediaStateTestCase() 
		{
			super()
		}
		
		override public function setUp():void 
		{
			loader = new Loader();
		}
		
		public function testLoad():void
		{
			var url:URLRequest = new URLRequest("http://ww1.sinaimg.cn/bmiddle/86fc25e1tw1djg2xzsjktj.jpg");
			var ansyEvent:Function = addAsync(onLoadComplete, 5000);
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, ansyEvent);
			loader.load(url);
		}
		
		protected function onLoadComplete(e:Event):void
		{
			assertEquals(e.type, Event.COMPLETE);
		}
	}
}